package com.gamejelly.broker.client;

import com.alibaba.fastjson2.JSON;

public class DefaultCodec implements ClientCodec {

    @Override
    public byte[] encode(Object object) {
        return JSON.toJSONBytes(object);
    }

    @Override
    public <R> R decode(byte[] bytes, Class<R> rClass) {
        return JSON.parseObject(bytes, rClass);
    }
}
